package cn.yunhe.controller;

import cn.yunhe.model.House;
import cn.yunhe.service.HouseBiz;
import com.github.pagehelper.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/*spring注解*/
@RestController(value = "houseAction")
public class HouseAction {

    /*spring注解*/
    @Autowired
    @Qualifier(value = "houseBiz")
    private HouseBiz houseBiz;


    @RequestMapping(value = "searchByConditions2House")
    public Map searchByConditions(int pageNum, int pageSize, House house){
        Map map=new HashMap();
        map.put("pageNum",pageNum);
        map.put("pageSize",pageSize);
        map.put("house",house);
        Page page=houseBiz.searchHouse(map);
        map.put("page",page);
        map.put("totalPages",page.getTotal());
        return map;
    }

 /*   public HouseBiz getHouseBiz() {
        return houseBiz;
    }

    public void setHouseBiz(HouseBiz houseBiz) {
        this.houseBiz = houseBiz;
    }*/
}
